import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from "@/Layout/Layout";


Vue.use(VueRouter)

const routes = [
    {
        path: '/login',
        name: 'Login',
        component: () => import("@/views/Login")
    },
    {
        path: '/frontlogin',
        component: () => import("@/views/FrontLogin")
    },
    {
        path: '*',
        component: () => import("@/views/404")
    },
    {
        path: '/',
        redirect: '/frontlogin',
        name: 'Layout',
        component: Layout,
        children: [
            {path: '/home', name: 'Home', component: () => import("@/views/Home")},

            {path: '/teacher', name: 'Teacher', component: () => import("@/views/Teacher")},

            {path: '/permission', name: 'Permission', component: () => import("@/views/Permission")},

            {path: '/department', component: () => import("@/views/Department")},

            {path: '/class', component: () => import("@/views/Class")},

            {path: '/course', component: () => import("@/views/Course")},

            {path: '/mstuchoose', component: () => import("@/views/MStuChoose")},

            {path: '/profession', component: () => import("@/views/Profession")},

            {path: '/stuchoose', component: () => import("@/views/StuChoose")},

            {path: '/permission', component: () => import("@/views/Profession")},

            {path: '/stuhaschoose', component: () => import("@/views/StuHasChoose")},

            {path: '/teacourse', component: () => import("@/views/TeaCourse")},

            {path: '/teagrade', component: () => import("@/views/TeaGrade")},

            {path: '/personalcenter', component: () => import("@/views/PersonalCenter")},

            {path: '/echarts', component: () => import("@/views/ECharts")},

            {path: '/admin', component: () => import("@/views/Admin")},

            {path: '/student', component: () => import("@/views/Student")},

            {path: '/stuscore', component: () => import("@/views/StuScore")},
        ]
    }
]


const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
